from typing import List, Optional, Dict, Any
from pydantic import BaseModel
from typing import Optional
from .ModelConfig import ModelConfig

class Message(BaseModel):
    content: str
    role: str
    session_id: str

class ChatMessageDTO(BaseModel):

    model: str
    stream: bool
    top_k: Optional[int] = 1
    max_results: Optional[int] = 5
    ranker: bool = True
    messages: List[Message]
    m_config: Optional[ModelConfig] = ModelConfig(temperature=0.8,top_p=0.9,max_tokens=1000)

if __name__ == '__main__':
    c = ChatMessageDTO(model="aaa",stream=True, top_k=1, max_results=1,ranker= True)
    print(c)
    print(c.m_config)